<template>
	<view class="index-box">
		<sww-nav-bar :title="title"></sww-nav-bar>
		<card-echange ref="modulePageRef"></card-echange>
	</view>
</template>
<script>
import { pageShare } from '../../mixins/pageShare';
import cardEchange from '@/pagecomponents/exchange/card.vue';
import { mapState } from 'vuex';
export default {
	mixins: [pageShare],
	props: {
		tabIndex: {
			type: Number,
			default: 0
		}
	},
	data() {
		return {
			title: ''
		};
	},
	components: { 'card-echange': cardEchange },
	computed: {
		...mapState(['vuex_tab_bar'])
	},
	mounted() {
		let obj = this.vuex_tab_bar.list[this.tabIndex];
		this.title = obj.query.title || obj.text;
	},
	methods: {
		$onShow() {
			this.$nextTick(() => {
				this.$refs.modulePageRef.$onShow();
			});
		}
	}
};
</script>
<style scoped lang="scss"></style>
